<?php

class ContactPage {

	function __construct($ServicesPageID, $ServicesPageHTML, $timestamp) {
			$this->ID = $ServicesPageID;
			$this->BodyHTML = $ServicesPageHTML;
			$this->timestamp = $timestamp;
		}
		
	var $ID;
	function get_ID () { return $this->ID; }
	
	var $BodyHTML;
	function get_BodyHTML () { return $this->BodyHTML; }
	
	var $timestamp;
	function get_timestamp () { return $this->timestamp; }
	
	function get_mostRecentPage()
	{
		include(dirname(__FILE__) . "/../Database.inc");
		
		$link = ConnectToDatabase2();
		$sql = "SELECT `body_html`, `insert_tstamp`, `id` from `contact` where `insert_tstamp` IN (SELECT MAX(`insert_tstamp`) FROM `contact`)";
		$result = RunSql($sql, $link);

		$row = mysql_fetch_assoc($result);

	    $this->ID = $row['id'];
		$this->BodyHTML = html_entity_decode(stripslashes($row['body_html']));
		$this->timestamp = $row['insert_tstamp'];
	}
}
?>